package cousin.bean;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

public class MyDataProcess implements BeanPostProcessor  {
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        if (bean instanceof MyDataSource) {
            System.out.println("4.执行Bean后处理器的前置处理方法: postProcessBeforeInitialization");
        }
        return bean;
    }
    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        if (bean instanceof MyDataSource) {
            System.out.println("7.执行Bean后处理器的后置处理方法: postProcessAfterInitialization");
        }
        return bean;
    }
}
